<?php
namespace Dms\Controller;
use Think\Controller;

class CommonController extends Controller 
{
    public function _initialize()
    {
        $Auth = new \Model\Auth();
        $result = $Auth->common("/".MODULE_NAME."/".CONTROLLER_NAME."/".ACTION_NAME);

        if($result['valid'] == false)
        {
            if($result['errorCode'] == '00001')
            {
                $this->error($result['result'],U(MODULE_NAME.'/Public/login'));
            }
            else
            {
                $this->error($result['result']);
            }
        }

        $menu = menu();
        $mlist = array();
        foreach ($menu as $key=>$item){
            $url = trim($item['url']);
            if(strpos($url,'/Dms') !== false){
                $mlist[] = $item;
            }
        }
        $this->menuList = $mlist;
	}

}